SMTP Client implementation [on hold]

Posted by orif on Super User See other posts from Super User or by orif
Published on 2013-11-06T14:02:27Z Indexed on 2013/11/07 10:00 UTC
Read the original article Hit count: 263

I'm implementing SMTP client. What should the client do once it already sent the "." at the end of the mail, but didn't receive "250 Ok"?

This is how the conversation between the client and server look like:

Server Response: 220 www.sample.com ESMTP Postfix
Client Sending : HELO domain.com
Server Response: 250 Hello domain.com
Client Sending : MAIL FROM: <[email protected]>
Server Response: 250 Ok
Client Sending : RCPT TO: <[email protected]>
Server Response: 250 Ok
Client Sending : DATA
Server Response: 354 End data with <CR><LF>.<CR><LF>
Client Sending : Subject: Example Message
Client Sending : From: [email protected]
Client Sending : To: [email protected]
Client Sending :
Client Sending : TEST MAIL
Client Sending : 
Client Sending : .
Server Response: 250 Ok: queued as 23411
Client Sending : QUIT

I'm not sure what should I do if the client sends "." and doesn't receive the 250 Ok - because of possible network error. Was the "." sent or not? Should the client resend the mail - and - maybe - duplicate the item, or not - and risk in losing an important mail item?

Thank you.

© Super User or respective owner

Related posts about networking

Related posts about smtp